From: Keir Fraser Date: Sun, 27 Mar 2011 08:30:35 +0000 (+0100) Subject: x86_32: Fix _raw_read_trylock() build on some gcc versions. X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=6e111d0a8eb6a143a4e2b2367081d342a41dcccd;p=xen.git x86_32: Fix _raw_read_trylock() build on some gcc versions. Was broken by 23099:612171ff82ea. A bool_t is a single byte, and needs a 'q' register constraint. Avoid the whole issue by changing the variable to an int, and explicitly specify the operand suffix as 'l' for good measure. Signed-off-by: Keir Fraser --- diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h index 5f9fabd345..a31f8b725b 100644 --- a/xen/include/asm-x86/spinlock.h +++ b/xen/include/asm-x86/spinlock.h @@ -40,14 +40,14 @@ typedef struct { static always_inline int _raw_read_trylock(raw_rwlock_t *rw) { - bool_t acquired; + int acquired; asm volatile ( " lock; decl %0 \n" " jns 2f \n" "1: .subsection 1 \n" "2: lock; incl %0 \n" - " dec %1 \n" + " decl %1 \n" " jmp 1b \n" " .subsection 0 \n" : "=m" (rw->lock), "=r" (acquired) : "1" (1) : "memory" );